#include "StdAfx.h"
#include "QueryManager.h"
#include <boost/foreach.hpp>
QueryManager*  QueryManager::queryManager = NULL;
QueryManager::QueryManager(void)
{
}


QueryManager::~QueryManager(void)
{
}

QueryManager* QueryManager::getInstance(void)
{
	if (queryManager==NULL)
	{
		queryManager = new QueryManager();
	}
	return queryManager;
}
void QueryManager::addStreamInput(boost::shared_ptr<IStreamInput> streamInput)
{
	this->streamInputMap.insert(make_pair(streamInput->getId(),streamInput));
}
void QueryManager::addStreamOutput(boost::shared_ptr<IStreamOutput> streamOutput)
{
	this->streamOutput = streamOutput;
}
boost::shared_ptr<IStreamInput>  QueryManager::getStreamInputById(std::string id)
{
	std::map<std::string, boost::shared_ptr<IStreamInput> >::iterator it;
	it = streamInputMap.find(id);
	assert(it!=streamInputMap.end());
	
	return it->second;
		
}
boost::shared_ptr<IStreamOutput> QueryManager::getStreamOutput( )
{
	return this->streamOutput;
}